home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.10 Oct 95 / SlimApp / SlimApp ƒ / SlimApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-17  |  2.5 KB  |  99 lines  |  [TEXT/MMCC]

  1. /*==========================================================================
  2.  
  3.                                 SlimApp.h
  4.                                 
  5.     This file defines functions to determine if the running application    
  6.     is a fat application and if so, to strip the unneeded code from the
  7.     application.
  8.     
  9.     Add the file "SlimApp.c" to your project and include this header file
  10.     in any source files that call the stripping routines.
  11.  
  12.     Copyright 1995 by Blake Ward.
  13.  
  14.     Permission is granted for unrestricted use, provided the author
  15.     is credited.
  16.         
  17.   ==========================================================================*/
  18.  
  19. #ifndef __SLIMAPP__
  20. #define __SLIMAPP__
  21.  
  22.  
  23. // We need this so that these routines are correctly defined when called from
  24. // .cp files.
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29.  
  30.  
  31. /*==========================================================================
  32.     Stuctures and Contants
  33.   ==========================================================================*/
  34.  
  35. #define k68KApplication            1
  36. #define kPowerPCApplication        2
  37. #define kFatBinaryApplication    3
  38.  
  39.  
  40.  
  41.  
  42. /*==========================================================================
  43.     IDs For Resources
  44.   ==========================================================================*/
  45.  
  46. // These ID's are for the stub that we insert when stripping away 68K code.
  47. // These resources are created with a separate project and then copied
  48. // into SlimApp.rsrc with their types and ID's changed to the following values.
  49. #define kStubCODEType    'CoDe'
  50. #define kStubDATAType    'DaTa'
  51. #define kStubCodeID        9998        // & 9999
  52. #define kStubDataID        9999
  53.  
  54. // Error and warning dialogs
  55. #define kCodeStripFailedErrorDialog        9999
  56.  
  57. // STR# Resource
  58. #define kSlimAppStrings    9999
  59.  
  60. // Indexed strings in kSlimAppStrings
  61. #define kFatBinaryFileName            1
  62. #define kFatBinaryLabel                2
  63. #define kPowerPCLabel                3
  64. #define k68KLabel                    4
  65. #define kStripPowerPCButtonLabel    5
  66. #define kStrip68KButtonLabel        6
  67. #define kPowerMacOnlyWarning        7
  68. #define k68KOnlyWarning                8
  69. #define kFatBinaryVersionName        9
  70. #define k68KVersionName                10
  71. #define kPowerMacVersionName        11
  72.  
  73.  
  74.  
  75. /*==========================================================================
  76.     Prototypes Of Functions Shared With Other Source Files
  77.   ==========================================================================*/
  78.  
  79. OSErr Has68KPowerPCCode(void);
  80.  
  81. Boolean SafeToStrip(void);
  82.  
  83. OSErr StripFatApplication(void);
  84.  
  85. short int GetApplicationResourceFork(void);
  86.  
  87. void GetShortVersion(StringPtr versMsg);
  88.  
  89. void GetLongVersion(StringPtr versMsg);
  90.  
  91. OSErr SetLongVersion(StringPtr versionStr);
  92.  
  93.  
  94. #ifdef __cplusplus
  95.     }
  96. #endif
  97.  
  98.  
  99. #endif